import LoginView from "@/views/LoginView.vue";
import RegisterView from "@/views/RegisterView.vue";
import Layout from "@/views/Layout.vue";
import Article from "@/views/Article.vue";
import Collect from "@/views/Collect.vue";
import Like from "@/views/Like.vue";
import User from "@/views/User.vue";
import Detail from "@/views/Detail.vue";
import Vue from "vue";
import VueRouter from "vue-router";

Vue.use(VueRouter);
Vue.config.productionTip = false;
const router = new VueRouter({
  routes: [
    { path: "/", redirect: "/LoginView" },
    { path: "/LoginView", component: LoginView },
    { path: "/RegisterView", component: RegisterView },
    {
      path: "/HmLayout",
      component: Layout,
      children: [
        {
          path: "/HmLayout/HmArticle",
          component: Article,
        },
        {
          path: "/HmLayout/HmCollect",
          component: Collect,
        },
        {
          path: "/HmLayout/HmLike",
          component: Like,
        },
        {
          path: "/HmLayout/HmUser",
          component: User,
        },
      ],
    },
    {
      path: "/HmDetail/:id",

      component: Detail,
    },
    //提供类名别名
  ],
  linkActiveClass: "active",
  linkExactActiveClass: "exact-active",
});

export default router;
